Skip to content

RDKEMW-9237: Adding secure mount support. - #354

Merged
nhanasi merged 3 commits into
support/3.0.5from
feature/WNCXIONE-530-8.3
Oct 31, 2025
Merged

RDKEMW-9237: Adding secure mount support.#354
nhanasi merged 3 commits into
support/3.0.5from
feature/WNCXIONE-530-8.3

Conversation

@bpunnuru

Copy link
Copy Markdown
Contributor

No description provided.

Balaji Punnuru and others added 2 commits October 29, 2025 11:59
Signed-off-by: Balaji Punnuru <Balaji_Punnuru@comcast.com>
(cherry picked from commit 70f8618)

Co-authored-by: Aravindan NC <35158113+AravindanNC@users.noreply.github.com>
(cherry picked from commit 3dd2339)
@bpunnuru
bpunnuru requested a review from a team as a code owner October 31, 2025 17:02
Copilot AI review requested due to automatic review settings October 31, 2025 17:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new systemd configuration file to ensure NetworkManager starts after the securemount.service, and refactors the WiFi bootstrap script to support migration of WiFi credentials from non-secure to secure storage locations. The changes enhance security by handling WiFi configurations through the encrypted filesystem (ECFS).

Key changes:

  • New systemd unit configuration to establish a dependency on securemount.service
  • Refactored WiFi credential handling to migrate settings from /opt/NetworkManager to /opt/secure/NetworkManager
  • Added logic to use previously configured settings when no SSID is found in the supplicant configuration

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
systemd_units/NetworkManager_ecfs.conf Adds systemd unit configuration to ensure NetworkManager waits for securemount.service
lib/rdk/NM_Bootstrap.sh Refactors WiFi credential migration logic, adds secure storage handling, and implements fallback to previously configured settings

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/rdk/NM_Bootstrap.sh
rm -rf /opt/NetworkManager/system-connections/*
fi
if [ "$RDK_PROFILE" == "TV" ]; then
echo "`/bin/timestamp` :$0: Migrating Wifi credentials for TVs from NM_Bootsrtap" >> /opt/logs/NMMonitor.log

Copilot AI Oct 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corrected spelling of 'NM_Bootsrtap' to 'NM_Bootstrap'.

Suggested change
echo "`/bin/timestamp` :$0: Migrating Wifi credentials for TVs from NM_Bootsrtap" >> /opt/logs/NMMonitor.log
echo "`/bin/timestamp` :$0: Migrating Wifi credentials for TVs from NM_Bootstrap" >> /opt/logs/NMMonitor.log

Copilot uses AI. Check for mistakes.
Comment thread lib/rdk/NM_Bootstrap.sh
sed -i '/network={/,/}/d' /opt/secure/wifi/wpa_supplicant.conf
fi

if [ -z $SSID ]; then

Copilot AI Oct 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable $SSID should be quoted to handle empty strings correctly. Use [ -z \"$SSID\" ] instead. Without quotes, the test will fail if SSID is empty or unset.

Suggested change
if [ -z $SSID ]; then
if [ -z "$SSID" ]; then

Copilot uses AI. Check for mistakes.
Comment thread lib/rdk/NM_Bootstrap.sh
if [ "$RDK_PROFILE" == "TV" ]; then
echo "`/bin/timestamp` :$0: Migrating Wifi credentials for TVs from NM_Bootsrtap" >> /opt/logs/NMMonitor.log
fi
if [ -z $PSK ]; then

Copilot AI Oct 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable $PSK should be quoted to handle empty strings correctly. Use [ -z \"$PSK\" ] instead. Without quotes, the test will fail if PSK is empty or unset.

Suggested change
if [ -z $PSK ]; then
if [ -z "$PSK" ]; then

Copilot uses AI. Check for mistakes.
Comment thread lib/rdk/NM_Bootstrap.sh
SSID=$(cat $WIFI_WPA_SUPPLICANT_CONF | grep -w ssid= | cut -d '"' -f 2)
PSK_LINE=$(grep psk= "$WIFI_WPA_SUPPLICANT_CONF")

if [ -f $RDKV_SUPP_CONF ]; then

Copilot AI Oct 31, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Variable $RDKV_SUPP_CONF should be quoted to handle paths with spaces correctly. Use [ -f \"$RDKV_SUPP_CONF\" ] instead.

Suggested change
if [ -f $RDKV_SUPP_CONF ]; then
if [ -f "$RDKV_SUPP_CONF" ]; then

Copilot uses AI. Check for mistakes.
@bpunnuru bpunnuru changed the title Feature/wncxione 530 8.3 RDKEMW-9237: Adding secure mount support. Oct 31, 2025
@nhanasi
nhanasi merged commit 58914d6 into support/3.0.5 Oct 31, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants